package com.xmim.fulcrum.session;

import com.xmim.core.container.ServerContainer;
import com.xmim.core.container.handler.HandlerManager;
import com.xmim.core.exception.ContainerException;
import com.xmim.core.session.Session;
import com.xmim.fulcrum.FulcrumFactory;
import com.xmim.fulcrum.node.FulcrumServiceNode;

import java.util.Enumeration;
import java.util.Map;

public interface FulcrumSession<N, H> extends Session, ServerContainer<N, H> {

    FulcrumServiceNode getNode();

    @Override
    FulcrumSession<N, H> start() throws ContainerException;

    @Override
    boolean isConnect();

    @Override
    ServerContainer<N, H> getParent();

    @Override
    FulcrumFactory getFactory();

    @Override
    HandlerManager<N, H> addHandler(N type, H handler);

    @Override
    boolean checkHandler(Class<?> handler);

    @Override
    H getHandler(N type);

    @Override
    Enumeration<Map.Entry<N, H>> enumerations();

    @Override
    FulcrumSession<N, H> writeAndFlush(Object pkg);

    @Override
    FulcrumSession<N, H> close() throws ContainerException;
}
